<template>
  <div class="container">
    <el-dialog title="分货单详情" :visible.sync="dialogs.centerDialogVisible" @open="getData" center>
      <el-table :data="tableData" border style="width: 100%" empty-text="暂无数据">
        <el-table-column prop="goods_name" label="商品名称"  align="center"></el-table-column>
      <el-table-column prop="goods_num" label="出库数量"  align="center"></el-table-column>
      <el-table-column prop="chu_price" label="出库价格"  align="center"></el-table-column>
      <el-table-column prop="ru_price" label="入库价格" align="center"></el-table-column>
      </el-table>
      <!-- <div class="pagination">
        <el-pagination
          @size-change="handleCurrentChange"
          @current-change="handleSizeChange"
          :current-page.sync="pageData.page"
          :page-sizes="pageData.pageSizes"
          :page-size="pageData.pageSize"
          :layout="pageData.layout"
          :total="pageData.total"
        ></el-pagination>
      </div> -->
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { cargoOrderDetails } from "@/api/sortGoods/sortGoodsList";
export default {
  props: {
    dialogs: Object
  },
  data() {
    return {
      tableData: [],
      // pageData: {
      //   pageSizes: [10, 20],
      //   pageSize: 10,
      //   page: 1,
      //   total: null,
      //   layout: "total, sizes, prev, pager, next, jumper"
      // }
    };
  },
  methods: {
    confirm() {
      this.dialogs.centerDialogVisible = false;
    },
    getData() {
      let data = {
        // limit: this.pageData.pageSize,
        // page: this.pageData.page,
        pickingid: this.dialogs.id
      };
      cargoOrderDetails(data).then(res => {
        if (res.code == 0) {
            this.tableData = res.data;
          // this.pageData.page = res.data.current_page;
          //   this.pageData.pagesize = res.data.per_page;
          //   this.pageData.total = res.data.total;
        }
      });
    },
    //每页多少条
    handleCurrentChange(val) {
      this.pageData.page = 1;
      this.pageData.pageSize = val;
      this.getData();
    },
    //选取页数
    handleSizeChange(page) {
      this.pageData.page = page;
      this.getData();
    }
  }
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
}
</style>